from typing import *


class Solution:
    def divisorSubstrings(self, num: int, k: int) -> int:
        a = map(int, list(str(num)))
        n, m = 0, pow(10, k - 1)
        ans = 0
        for i, v in enumerate(a):
            n = n * 10 + v
            if i >= k - 1:
                if n != 0 and num % n == 0:
                    ans += 1
                n %= m
        return ans


s = Solution()
print(s.divisorSubstrings(240, 2))
